import { createApp } from 'vue'
import {
  ElButton,
  ElSelect,
  ElContainer,
  ElAside,
  ElMenu,
  ElMenuItemGroup,
  ElSubmenu,
  ElMenuItem,
  ElHeader,
  ElDropdown,
  ElDropdownMenu,
  ElDropdownItem,
  ElTable,
  ElTableColumn,
  ElMain,
  ElTooltip,
  ElInput,
  ElForm,
  ElFormItem,
} from 'element-plus'
import lang from 'element-plus/lib/locale/lang/zh-cn'
import 'dayjs/locale/zh-cn'
import locale from 'element-plus/lib/locale'
// import 'element-plus/lib/theme-chalk/index.css'
// 如果要使用.scss样式文件，则需要引入base.scss文件
import 'element-plus/packages/theme-chalk/src/base.scss'
import App from './App.vue'
import router from './router'
import store from './store'

// 设置语言
if (typeof locale === 'function') {
  locale(lang)
} else {
  locale.use(lang)
}

const app = createApp(App)

app.use(router)

app.use(ElButton)
app.use(ElSelect)
app.use(ElContainer)
app.use(ElAside)
app.use(ElMenu)
app.use(ElMenuItemGroup)
app.use(ElSubmenu)
app.use(ElMenuItem)
app.use(ElHeader)
app.use(ElDropdown)
app.use(ElDropdownMenu)
app.use(ElDropdownItem)
app.use(ElTable)
app.use(ElTableColumn)
app.use(ElMain)
app.use(ElTooltip)
app.use(ElInput)
app.use(ElForm)
app.use(ElFormItem)

app.use(store)

app.mount('#app')
